目录
echarts 基本配置项记录
1
2
3
4
//图表自适应宽高
window.onresize = function(){
myChart.resize();
};
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
//title主标题
title:{
show:true,
text:'标题',
link:'www.baidu.com', //主标题文本超链接
textStyle:{
color:'#333',
fontSize:18,
align:'left', //文字水平对齐方式,默认自动。 left center right
verticalAlign:'top' //文字垂直对齐方式,默认自动。 top middle bottom
},
subtext:'副标题', //支持使用 \n 换行。
sublink:'超链接', //副标题超文本链接
padding:5, //内边距 5 /上下5左右10 padding:[5,10] /padding:[5,10,5,10] 上右下左
}
1
2
3
4
5
6
7
8
//图例组件
legend: {
show:true,
data:['数据1', '数据2', '数据3'],
right:'5%', //位置离右侧距离 也可px left/top/bottom
orient:'visualMap', //图例列表的布局朝向.纵向 横向orient:'horizontal'
align:'left', //图例标记和文本的对齐 左右位置
},
1
2
3
4
5
6
7
8
9
10
11
12
//xAxis X轴
xAxis:{
show:true, //是否显示
position:bottom, //x轴位置 top/bottom
nameLocation:'end', //坐标轴名称显示位置 start/end/middle/center
nameTextStyle:{
color:'',
fontFamily:'',
fontSize:12,
align:'left' //坐标轴名称文字水平对齐方式
},
}
1
2
3
4
5
6
7
//textStyle 全局的字体样式
textStyle:{
color:'#fff',
fontFamily:'宋体',
fontsize:12
}
文章作者: 艾小逗
文章链接: http://foryh.com/2017/09/25/echarts 基本配置项记录/
版权声明: 本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来自 艾小逗
打赏
  • 微信
  • 支付寶